#pragma once

#include <string>
#include <thread> 




class HttpServer {
public:
    HttpServer(int port);
    void Start();

private:
    void run();
    void handle_client(int client_fd);
    void parse_request(int client_fd, const std::string& request);
    void handle_post_request(int client_fd, const std::string path, const std::string& request);
    void handle_get_request(int client_fd, const std::string path, const std::string& request);
    void send_response(int client_fd, const std::string& request);

private:
    int __server_fd;
    int __port;
    std::thread __server_thread; 
    std::string __score;
};